package com.hw.protocol.tool.controller;

import com.hw.protocol.tool.config.DecodeContext;
import de.felixroske.jfxsupport.FXMLController;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

/**
 * @author : lihy
 * @date : 2024/3/18 10:19
 * description:
 */
@FXMLController
public class JkKeyController {

    @FXML
    public TextField txtSessionKey;

    @FXML
    public TextField txtMacKey;

    @FXML
    public Button btnOk;

    @FXML
    public void save(ActionEvent actionEvent) {
        DecodeContext.KEY_STATUS.setValue("sessionKey:"+txtSessionKey.getText()+"||"+"macKey:"+txtMacKey.getText());
        DecodeContext.jkSessionkey = txtSessionKey.getText();
        DecodeContext.jkMackey = txtMacKey.getText();
        Stage stage = (Stage) btnOk.getScene().getWindow();
        stage.close();

    }
}
